import request from '@/utils/request';
import { rsaEncrypt } from '@/utils/commonUtil3';

// 非标商品
// 添加非标商品
export function genericGoodsAdd(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/supplyNonstandard/insert',
		method: 'post',
		data: {
			data: data1
		}
	});
}

// 获取非标商品列表
export function getGenericGoodsList(data) {
	return request({
		url: '/supplyNonstandard/select',
		method: 'get',
		params: data
	});
}

// 删除非标商品
export function genericGoodsDelete(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/supplyNonstandard/delete',
		method: 'delete',
		data: {
			data: data1
		}
	});
}

// 获取非标商品详情
export function getGenericGoodsDetail(data) {
	return request({
		url: '/supplyNonstandard/selectDetails',
		method: 'get',
		params: data
	});
}

// 修改非标商品
export function genericGoodsEdit(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/supplyNonstandard/update',
		method: 'put',
		data: {
			data: data1
		}
	});
}

// 门店预付款分页条件查询
export function getStoreAdvanceList(data) {
	return request({
		url: '/storeAdvance/select',
		method: 'get',
		params: data
	});
}

// 门店预付款详情查询
export function getStoreAdvanceDetail(data) {
	return request({
		url: '/storeAdvance/goAdd',
		method: 'get',
		params: data
	});
}
// 加款
export function addStoreAMoney(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/storeAdvance/add',
		method: 'post',
		data: {
			data: data1
		}
	});
}

// 门店预付款列表详情查询
export function getStoreAdvanceListDetail(data) {
	return request({
		url: '/storeAdvance/selectDetails',
		method: 'get',
		params: data
	});
}

// 查询非标商品审核列表
export const reqGenericGoodsList = data => request({ url: '/nonstandard/pick/select', method: 'GET', params: { ...data } });
// 非标商品审核/详情
export const reqGenericGoodsById = data => request({ url: '/nonstandard/pick/details', method: 'GET', params: { ...data } });
// 审核
export const reqToExamine = data => request({ url: '/nonstandard/pick/auditing', method: 'PUT', data: { data: rsaEncrypt(data) } });

// 获取非标分类列表
export function getGenericGoodsTypeList(data) {
	return request({
		url: '/nonCategory/select',
		method: 'get',
		params: data
	});
}

// 修改非标分类列表
export function updateGenericGoodsType(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/nonCategory/update',
		method: 'put',
		data: {
			data: data1
		}
	});
}

// 添加非标分类列表
export function addGenericGoodsType(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/nonCategory/insert',
		method: 'post',
		data: {
			data: data1
		}
	});
}

// 删除非标分类
export function deletetGenericGoodsType(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/nonCategory/delete',
		method: 'delete',
		data: {
			data: data1
		}
	});
}

// 修改非标商品价格
export function genericGoodsPriceEdit(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/supplyNonstandard/updatePrice',
		method: 'post',
		data: {
			data: data1
		}
	});
}
